# Following Flask tutorial
# http://flask.pocoo.org/docs/quickstart/

# install virtualenv, pip, flask

from flask import Flask, url_for, render_template

app = Flask(__name__)

@app.route('/')
def index_page():
    return render_template('index.html')

@app.route('/debug/<value>')
def debug_page(valuel):
    title = "New Flask Framework"

    return title

@app.route('/helloworld')
def hello_world():
    return "Hello World!"

@app.route('/user/<userid>')
def post_user(userid):
    return render_template('user.html', name=userid)

@app.route('/testing')
def test_page():
    return "This is a test"

with app.test_request_context():
    print url_for('index_page')
    print url_for('static', filename='style.css')
    print url_for('debug_page', value=1)
    print url_for('debug_page', value=2)
    print url_for('test_page', next='test_page1')

if __name__ == '__main__':
    app.run()
